<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="集团">
              <a-input placeholder="请输入集团" v-model="queryParam.mandt"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="资产编号">
              <a-input placeholder="请输入资产编号" v-model="queryParam.anln1"></a-input>
            </a-form-item>
          </a-col>
        <template v-if="toggleSearchStatus">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="资产子编码">
              <a-input placeholder="请输入资产子编码" v-model="queryParam.anln2"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="年度">
              <a-input placeholder="请输入年度" v-model="queryParam.gjahr"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="期间">
              <a-input placeholder="请输入期间" v-model="queryParam.monat"></a-input>
            </a-form-item>
          </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('资产明细中间表管理')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <ztbZfi011Log-modal ref="modalForm" @ok="modalFormOk"></ztbZfi011Log-modal>
  </a-card>
</template>

<script>
  import '@/assets/less/TableExpand.less'
  import ZtbZfi011LogModal from './modules/ZtbZfi011LogModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'

  export default {
    name: "ZtbZfi011LogList",
    mixins:[JeecgListMixin],
    components: {
      ZtbZfi011LogModal
    },
    data () {
      return {
        description: '资产明细中间表管理管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
		   {
            title: '集团',
            align:"center",
            dataIndex: 'mandt'
           },
		   {
            title: '资产编号',
            align:"center",
            dataIndex: 'anln1'
           },
		   {
            title: '资产子编码',
            align:"center",
            dataIndex: 'anln2'
           },
		   {
            title: '年度',
            align:"center",
            dataIndex: 'gjahr'
           },
		   {
            title: '期间',
            align:"center",
            dataIndex: 'monat'
           },
		   {
            title: '科目定位码

',
            align:"center",
            dataIndex: 'ktogr'
           },
		   {
            title: '序列号',
            align:"center",
            dataIndex: 'sernr'
           },
		   {
            title: '存货号',
            align:"center",
            dataIndex: 'invnr'
           },
		   {
            title: '资产分类
',
            align:"center",
            dataIndex: 'anlkl'
           },
		   {
            title: '资产分类描述
',
            align:"center",
            dataIndex: 'txk20'
           },
		   {
            title: '信用范围
',
            align:"center",
            dataIndex: 'gsber'
           },
		   {
            title: '资产描述
',
            align:"center",
            dataIndex: 'txt50'
           },
		   {
            title: '规格型号附加资产描述
',
            align:"center",
            dataIndex: 'txa50'
           },
		   {
            title: '数量',
            align:"center",
            dataIndex: 'menge'
           },
		   {
            title: '单位

',
            align:"center",
            dataIndex: 'meins'
           },
		   {
            title: '最后库存日
',
            align:"center",
            dataIndex: 'ivdat'
           },
		   {
            title: '补充库存说明
',
            align:"center",
            dataIndex: 'invzu'
           },
		   {
            title: '资产资本化日期
',
            align:"center",
            dataIndex: 'aktiv'
           },
		   {
            title: '使用状态
',
            align:"center",
            dataIndex: 'ord41'
           },
		   {
            title: '使用状态描述
',
            align:"center",
            dataIndex: 'ordt1'
           },
		   {
            title: '类别名称
',
            align:"center",
            dataIndex: 'ord42'
           },
		   {
            title: '类别名称描述
',
            align:"center",
            dataIndex: 'ordt2'
           },
		   {
            title: '设备属性
',
            align:"center",
            dataIndex: 'ord43'
           },
		   {
            title: '设备属性描述
',
            align:"center",
            dataIndex: 'ordt3'
           },
		   {
            title: '分类
',
            align:"center",
            dataIndex: 'ord44'
           },
		   {
            title: '分类描述
',
            align:"center",
            dataIndex: 'ordt4'
           },
		   {
            title: '资产来源
',
            align:"center",
            dataIndex: 'gdlgrp'
           },
		   {
            title: '资产制造商
',
            align:"center",
            dataIndex: 'herst'
           },
		   {
            title: '投资订单
',
            align:"center",
            dataIndex: 'eaufn'
           },
		   {
            title: '成本中心
',
            align:"center",
            dataIndex: 'kostl'
           },
		   {
            title: '成本中心描述
',
            align:"center",
            dataIndex: 'ltext'
           },
		   {
            title: '资产地点
',
            align:"center",
            dataIndex: 'stort'
           },
		   {
            title: '房间
',
            align:"center",
            dataIndex: 'raumn'
           },
		   {
            title: '资产停用
',
            align:"center",
            dataIndex: 'xstil'
           },
		   {
            title: '资产主号说明',
            align:"center",
            dataIndex: 'anlhtxt'
           },
		   {
            title: '折旧码
',
            align:"center",
            dataIndex: 'afasl'
           },
		   {
            title: '计划年使用期
',
            align:"center",
            dataIndex: 'ndjar'
           },
		   {
            title: '计划使用期间
',
            align:"center",
            dataIndex: 'ndper'
           },
		   {
            title: '折旧计算开始日期
',
            align:"center",
            dataIndex: 'afabg'
           },
		   {
            title: '资产残值
',
            align:"center",
            dataIndex: 'schrw'
           },
		   {
            title: '已使用年限
',
            align:"center",
            dataIndex: 'ndabj'
           },
		   {
            title: '已使用期限余月
',
            align:"center",
            dataIndex: 'ndabp'
           },
		   {
            title: '累积购置和生产费用
',
            align:"center",
            dataIndex: 'kansw'
           },
		   {
            title: '重置价值的累计重估
',
            align:"center",
            dataIndex: 'kaufw'
           },
		   {
            title: '以前年度累计正常折旧
',
            align:"center",
            dataIndex: 'knafa'
           },
		   {
            title: '本年正常折旧
',
            align:"center",
            dataIndex: 'nafap'
           },
		   {
            title: '该年度影响资产值的业务
',
            align:"center",
            dataIndex: 'answl'
           },
		   {
            title: '资产原值
',
            align:"center",
            dataIndex: 'zcyz'
           },
		   {
            title: '累计折旧
',
            align:"center",
            dataIndex: 'ljzj'
           },
		   {
            title: '当月折旧
',
            align:"center",
            dataIndex: 'dyzj'
           },
		   {
            title: '本年折旧
',
            align:"center",
            dataIndex: 'nafag'
           },
		   {
            title: '资产净残值
',
            align:"center",
            dataIndex: 'zcjcz'
           },
		   {
            title: '单位文本
',
            align:"center",
            dataIndex: 'msehl'
           },
		   {
            title: '净值
',
            align:"center",
            dataIndex: 'zjz'
           },
		   {
            title: '供应商名称
',
            align:"center",
            dataIndex: 'liefe'
           },
		   {
            title: '供应商编号
',
            align:"center",
            dataIndex: 'lifnr'
           },
		   {
            title: '供应商名称2
',
            align:"center",
            dataIndex: 'name1'
           },
		   {
            title: '责任成本中心
',
            align:"center",
            dataIndex: 'kostlv'
           },
		   {
            title: '责任成本中心描述
',
            align:"center",
            dataIndex: 'ktext1'
           },
		   {
            title: '内部订单
',
            align:"center",
            dataIndex: 'caufn'
           },
		   {
            title: '内部订单描述
',
            align:"center",
            dataIndex: 'ktext2'
           },
		   {
            title: '工厂
',
            align:"center",
            dataIndex: 'werks'
           },
		   {
            title: '工厂描述
',
            align:"center",
            dataIndex: 'name2'
           },
		   {
            title: '当前已用年限
',
            align:"center",
            dataIndex: 'zzyear'
           },
		   {
            title: '当前已用月份
',
            align:"center",
            dataIndex: 'zzmonth'
           },
		   {
            title: '状态',
            align:"center",
            dataIndex: 'zstatus'
           },
		   {
            title: '公司代码',
            align:"center",
            dataIndex: 'bukrs'
           },
		   {
            title: '更新日期',
            align:"center",
            dataIndex: 'zdate'
           },
		   {
            title: '更新时间',
            align:"center",
            dataIndex: 'ztime'
           },
		   {
            title: '流程ID',
            align:"center",
            dataIndex: 'requestid'
           },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
		url: {
          list: "/assets/ztbZfi011Log/list",
          delete: "/assets/ztbZfi011Log/delete",
          deleteBatch: "/assets/ztbZfi011Log/deleteBatch",
          exportXlsUrl: "assets/ztbZfi011Log/exportXls",
          importExcelUrl: "assets/ztbZfi011Log/importExcel",
       },
    }
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
    methods: {
     
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>